<template>
  <div class="login">
    <div class="login-wrapper">
      <h2>login</h2>
      <div class="input-data">
        <label for="username">
          <svg class="icon icon-svg" aria-hidden="true">
            <use xlink:href="#icon-yonghu"></use>
          </svg>
        </label>
        <input
          class="login-input"
          type="text"
          id="username"
          placeholder="请输入用户名"
          required
        />
      </div>

      <div class="input-data">
        <label for="password">
          <svg class="icon icon-svg" aria-hidden="true">
            <use xlink:href="#icon-mima"></use>
          </svg>
        </label>
        <input
          class="login-input"
          type="text"
          id="password"
          placeholder="请输入密码"
          required
        />
      </div>
      <input class="login-btn" type="button" value="登录" />
      <div class="login-link">
        <router-link class="link-home" :to="{ name: 'home' }"
          >返回首页</router-link
        >
        <a class="link-switch" href="#">忘记密码</a>
        <router-link class="link-register" :to="{ name: 'register' }"
          >立即注册</router-link
        >
      </div>
    </div>
    <Footer></Footer>
  </div>
</template>

<script>
import Footer from "./Footer";
export default {
    components:{
        Footer
    }
};
</script>

<style lang="less" scoped>
.login {
    height: 100vh;
    display: flex;
    align-items: flex-end;
  .login-wrapper {
    background-color: #fff;
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    padding: 0 30px;
    box-sizing: border-box;
    border-radius: 10px;
    h2 {
      font-size: 40px;
      padding: 10px 0;
    }
    input {
      width: 100%;
      height: 40px;
      outline: none;
    }
    .input-data {
      width: 100%;
      position: relative;
      label {
        position: absolute;
        top: 50%;
        left: 1%;
        transform: translateY(-50%);
        .icon-svg {
          width: 1.5em;
          height: 1.5em;
        }
      }
      .login-input {
        padding: 10px 10px 10px 7%;
        box-sizing: border-box;
        outline: none;
        font-size: 18px;
        border: none;
        box-shadow: 0 0 1px 1px rgb(184, 184, 184);
        transition: all 0.3s ease;
      }
      .login-input:hover {
        box-shadow: 0 0 1px 2px rgb(184, 184, 184);
      }
      .login-input:focus {
        box-shadow: 0 0 1px 2px rgb(126, 171, 255);
      }
    }
    .login-btn {
      border: none;
      background-color: rgb(64, 158, 255);
      color: #fff;
      border-radius: 10px;
      cursor: pointer;
    }
    .login-btn:hover {
      background-color: rgb(126, 171, 255);
    }
    .login-link {
      width: 100%;
      a {
        text-decoration: none;
        color: black;
      }
      .link-home {
        color: rgb(184, 184, 184);
        margin-right: 40%;
      }
      .link-home,
      .link-register {
        margin-left: 20px;
      }
    }
  }
}
.login::before {
  content: "";
  position: fixed;
  background-image: url("../assets/img/366d1d26b3ec728181685ea7db9cecc1.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
}
</style>